import book.BookList;
import user.AdminUser;
import user.NormalUser;
import user.User;

import java.util.Scanner;

public class Main {
    public static User login(){
        System.out.println("请输入你的姓名：");
        Scanner scanner = new Scanner(System.in);
        String userName = scanner.nextLine();
        System.out.println("请输入你的登录身份：1.用户 2.管理员");
        int choice = scanner.nextInt();
        if(choice == 1){
            return new NormalUser(userName);
        }else {
            return new AdminUser(userName);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        while (true){
            int  choice = user.menu();
            user.doOparetor(choice, bookList);
        }
    }
}
